const router = require('koa-router')();
const newsModel = require('../model/news');
// 获取新闻
router.get('/news', async (ctx, next) => {
    await newsModel.getNews(ctx);
});
// 增加新闻
router.post('/add/news', async (ctx, next) => {
    await newsModel.addNews(ctx);
});
// 删除新闻
router.post('/delete/news', async (ctx, next) => {
    await newsModel.deleteNews(ctx);
});
// 编辑新闻
router.post('/edit/news', async (ctx, next) => {
    await newsModel.editNews(ctx);
});
module.exports = router;